//
//  KVNBannerCollectionViewCell.m
//  Test1
//
//  Created by KelvinYeung on 15/8/11.
//  Copyright (c) 2015年 KelvinYeung. All rights reserved.
//

#import "KVNBannerCollectionViewCell.h"

@implementation KVNBannerCollectionViewCell

- (instancetype) initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    [self initSubviews];
    return self;
}

- (void) initSubviews{

    _imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"cell_loading"]];
    [self.contentView addSubview:_imageView];
    _imageView.translatesAutoresizingMaskIntoConstraints = NO;
    
    [self.contentView addConstraint:[NSLayoutConstraint constraintWithItem:_imageView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1 constant:0]];
    
    [self.contentView addConstraint:[NSLayoutConstraint constraintWithItem:_imageView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1 constant:0]];
    [self.contentView addConstraint:[NSLayoutConstraint constraintWithItem:_imageView attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeRight multiplier:1 constant:0]];
    [self.contentView addConstraint:[NSLayoutConstraint constraintWithItem:_imageView attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeBottom multiplier:1 constant:0]];

}
@end
